<?php namespace Common\Model;
use Hdphp\Model\Model;
/**
* 
*/
class Type extends Model
{
	 //指定表名
	protected $table="Type";
	protected $validate=array(
 		array('tname','required','类型名称不能为空',3,3)
 		);
	//添加
	public function store($tname)
	{
		if ($this->create()) {
			$arr=explode('|',$tname);
			foreach ($arr as $v) {
				$this->add(array('tname'=>$v));
			}
			return true;
		}
		return false;
	}
	public function edit($tid)
	{
		if ($this->create()) {
			$this->where("tid={$tid}")->save();
			return true;
		}
		return false;
	}
}

 ?>